//  @ Project : GagalPanen
//  @ File Name : plants.hpp
//  @ Date : 3/9/2011
//  @ Author : Irvan
//
//


#if !defined(_PLANTS_H)
#define _PLANTS_H

#include <fstream>
#include <vector>

#include "cell.hpp"
#include "plant.hpp"
#include "gameinterface.hpp"

class Plants {
public:
  // normal constructor
  Plants(GameInterface* game);

  // load game constructor
  Plants(GameInterface* game, std::ifstream& is);

  virtual void save(std::ofstream& os);
  
  virtual ~Plants();
  void advanceDay();
  void advanceTime();
  bool containsPlantAt(Cell* cell);
  void addPlant(Plant* plant);
  Plant* getPlantAt(Cell* cell);
  void removePlant(Plant* plant);

  void makeAllDead();
  void restartAllNotDeadToSeed();

  void transmutateOneRandomPlant(int new_plant_id);

private:
  GameInterface* game_;
  std::vector<Plant* > plants_;
};

#endif  //_PLANTS_H
